package com.trkj.controller.lzs;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.trkj.pojo.Recruitapply;
import com.trkj.pojo.Recruitplan;
import com.trkj.pojo.Salary;
import com.trkj.service.lzs.PayrollService;
import com.trkj.service.lzs.RecruitplanService;
import com.trkj.vo.Result2;
@Controller
public class RecruitplanController {	
	@Autowired
	private RecruitplanService recruitplanService;
	//查询
	@RequestMapping("lzs_findAllecruitplan")
	@ResponseBody
	public List<Recruitplan> Recruitplanwe(){
		List<Recruitplan> list = recruitplanService.Recruitplanfall();
	
		return list;
	}
	


//添加
	@RequestMapping("lzs_pecruitplantianjia")
	@ResponseBody
	public void tianjia(Timestamp recplanAcenddate  , Timestamp recplanActualdate,BigDecimal recplanActualmoney, String recplanDescribe, BigDecimal recplanEstimate,
		String recplanMode, String recplanModescribe,Timestamp recplanPenddate,String recplanPerson,String recplanPlace,Timestamp recplanPstartdate ){
		
		recruitplanService.tj(recplanAcenddate, recplanActualdate, recplanActualmoney, recplanDescribe, recplanEstimate, recplanMode, recplanModescribe, recplanPenddate, recplanPerson, recplanPlace, recplanPstartdate);
	
		
	}
	//修改
	@RequestMapping("lzs_Recruitplanlxiugai")
	@ResponseBody  
	public  Result2 Recruitplanxiugai(long recplanId, Timestamp recplanAcenddate  , Timestamp recplanActualdate,BigDecimal recplanActualmoney, String recplanDescribe, BigDecimal recplanEstimate,
			String recplanMode, String recplanModescribe,Timestamp recplanPenddate,String recplanPerson,String recplanPlace,Timestamp recplanPstartdate ){
		
		try {
			recruitplanService.lzs_Edit(recplanId, recplanAcenddate, recplanActualdate, recplanActualmoney, recplanDescribe, recplanEstimate, recplanMode, recplanModescribe, recplanPenddate, recplanPerson, recplanPlace, recplanPstartdate);
			return Result2.SUCCESS;
		} catch (Exception e) {
				e.printStackTrace();
			return Result2.failure(e.getMessage());
		}
		
	}
	
	@RequestMapping("lzs_Recruitplantj")
	@ResponseBody  
	 public Recruitplan chunq(Long recplanId) {
    	 return recruitplanService.chunen(recplanId);
     }
	
	//模糊
	@RequestMapping("Recruitplanchaxun")
	@ResponseBody
	public  List<Recruitplan> Query(String text){
		return (List<Recruitplan>) recruitplanService.queryByName(text);
	}
}